<?xml version="1.0" encoding="UTF-8"?>


<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    version="1.0" >
    <xsl:template match="/emploisdutemps">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simpleA4" page-height="21cm" page-width="29.7cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
      <fo:region-body/>
      <fo:region-before extent="1cm"/>
                    <fo:region-after extent="1cm"/>
                    <fo:region-start extent="1cm"/>
                    <fo:region-end extent="2cm"/>
    </fo:simple-page-master>

  </fo:layout-master-set>
  <fo:page-sequence master-reference="simpleA4">
  <fo:static-content flow-name="xsl-region-before">
                    <fo:block>Document réalisé par l'équipe 2</fo:block>
                </fo:static-content>
  <fo:flow flow-name="xsl-region-body">
 
   <fo:table border="0.5pt solid black" text-align="center" border-spacing="3pt" table-layout="fixed">
        <fo:table-column column-width="80px"/>
        <fo:table-column column-width="62px" />
        <fo:table-column column-width="62px"/>
        <fo:table-column column-width="62px" />
        <fo:table-column column-width="62px"/>
        <fo:table-column column-width="62px" />
        <fo:table-column column-width="62px"/>
	 <fo:table-column column-width="62px" />
        <fo:table-column column-width="62px"/>
        <fo:table-column column-width="62px" />
        <fo:table-column column-width="62px"/>
       
    <fo:table-header>        
          <fo:table-row>
            <fo:table-cell padding="6pt" border="1pt solid blue" background-color="silver" number-columns-spanned="11">
              <fo:block text-align="center" font-weight="bold">
                 Emploi du temps de SVTU
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
       </fo:table-header>
                   <!-- BODY -->
		    <xsl:for-each select="cours[parcours='Parcours_SVTU']">
                            <xsl:sort select="datedebut/annee"/>
                            <xsl:sort select="datedebut/mois"/>
                            <xsl:sort select="datedebut/jour"/>
                            <xsl:sort select="datedebut/heure"/>
                            <xsl:sort select="datedebut/minute"/>        
        <fo:table-body>
          <!-- 1er ligne -->
	  
          <fo:table-row>
            <fo:table-cell padding="6pt" border="1pt solid blue" background-color="silver" number-rows-spanned="1">
              <fo:block text-align="center" font-weight="bold">
					Jours-Heures
             </fo:block>
           </fo:table-cell>
         <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >            
			 <fo:block>
                           <xsl:value-of select="concat(datedebut/jour,'/',datedebut/mois,'/',datedebut/annee)"/>
                             </fo:block>
		               
                                 </fo:table-cell> 
        </fo:table-row>  
	
        <fo:table-row height="30mm">
                       
    <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                <fo:block>
		    <xsl:value-of select="datedebut/heure"/>:
		    <xsl:value-of select="datedebut/minute"/> - 
                    <xsl:value-of select="datefin/heure"/>:
		 <xsl:value-of select="datefin/minute"/>
		</fo:block>
                 </fo:table-cell>
                 <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
              <fo:block vertical-align="bottom">
                   <xsl:value-of select="resume"/>
                                        </fo:block>
                                     <fo:block vertical-align="bottom">
                                            <xsl:value-of select="@enseignant"/>
                                        </fo:block>
                                    <fo:block  vertical-align="bottom">
                                            <xsl:value-of select="location"/>
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
			    </xsl:for-each>
                    </fo:table>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>
</xsl:stylesheet>